import React, { useEffect, useState } from 'react';
import DescriptionsCondition from '@/components/DescriptionsCondition';
import DrawerCondition from '@/components/DrawerCondition';
import PopImgShow from '@/components/PopImgShow';
import { connect } from 'umi';
import { Space } from 'antd'
import { order_status, goodsType_status, operation_statusinfo, workType_status, } from '@/common/contact';
const PointDetail = (props) => {
  const { dispatch, detail = {}, onClose } = props;
  console.log(props)
  const formItems = [
    {
      label: '订单编号',
      name: 'orderSn',
    },
    {
      label: '商品名称',
      name: 'orderDesc',
      render: (e) => {
        const goods = e ? JSON.parse(e) : {}
        const { goodsCover, goodsName } = goods
        return <Space>
          <PopImgShow url={goodsCover}></PopImgShow>
          <div>{goodsName}</div>
        </Space>
      }
    },
    {
      label: '订单类型',
      name: 'orderType',
      render: (e) => {
        return goodsType_status[e]
      },
    },
    {
      label: '服务类型',
      name: 'workType',
      render: (e) => {
        return workType_status[e]
      }
    },
  
    {
      label: '应收',
      name: 'payFee',
    },
    {
      label: '实收',
      name: 'realPayFee',
    },
    {
      label: '欠费',
      name: 'remainMoney',
    },

    {
      label: '状态',
      name: 'status',
      render: (e) => {
        return order_status[e]
      },
    },
    {
      label: '商品数量',
      name: 'goodsAmount',
    },
    {
      label: '支付时间',
      name: 'payTime',
    },
    {
      label: '创建时间',
      name: 'createTime',
    },
    {
      label: '姓名',
      name: 'username',
    },
    {
      label: '头像',
      name: 'profile',
      render: (e) => {
        return <PopImgShow url={e}></PopImgShow>
      }
    },
    {
      label: '手机',
      name: 'mobile',
    },
    {
      label: '超额优惠',
      name: 'additionalDiscounts',
    },
    {
      label: '创建人',
      name: 'addAdminName',
    },
    {
      label: '复核人',
      name: 'checkAdminName',
    },
    {
      label: '复核时间',
      name: 'checkTime',
    },

    {
      label: '复核状态',
      name: 'operationStatus',
      render: (e) => {
        return operation_statusinfo[e]
      }
    },
  ];

  return (
    <DescriptionsCondition formItems={formItems} initialValues={detail}></DescriptionsCondition>
  );
};
export default connect(({ subscriber, loading }) => ({
  loading: loading.effects['subscriber/fetchUserDetail'],
}))(PointDetail);;
